﻿using UnityEngine;
using System.Collections;

/// <summary>
/// Creating instance of sounds from code with no effort
/// </summary>
public class SoundObjectScript : MonoBehaviour
{
	
	public float volume = 0.05f;
	public AudioSource audioSource;
	//private AudioSource audioSource;
	

	void Update()
	{
		audio.volume = volume;
	}
	
	/// <summary>
	/// Play the associated sound
	/// </summary>
	/// <param name="originalClip"></param>
	public void MakeSound()
	{	
		// As it is not 3D audio clip, position doesn't matter.
		audioSource.PlayOneShot(audioSource.clip);
	}
}
